fix: use safer conversion from QString to filesystem::path
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 22 Apr 2025 09:16:21 +0000 (11:16 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Thu, 24 Apr 2025 08:34:05 +0000 (08:34 +0000)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/common/filesystembase.cpp

index 7ab136b42df314214c0620fe29a8ea1f6b9099be..660e2d382c648c5b1a33b89b94fac1dc681256d7 100644 (file)
@@ -591,7 +591,7 @@ bool FileSystem::remove(const QString &fileName, QString *errorString)
 #endif
 
     try {
-        if (!std::filesystem::remove(std::filesystem::path{fileName.toUtf8().data()})) {
+        if (!std::filesystem::remove(std::filesystem::path{fileName.toStdWString()})) {
             if (errorString) {
                 *errorString = QObject::tr("File is already deleted");
             }